package example.fileupload;

import grpc.htsoft.fileupload.FileUploadResponse;
import io.grpc.stub.StreamObserver;

import java.util.concurrent.CountDownLatch;

public class FileUploadObserver implements StreamObserver<FileUploadResponse>

    {
        public FileUploadObserver() {
           System.out.println("FileUploadObserver created");
        }

        @Override
    public void onNext(FileUploadResponse fileUploadResponse) {
        System.out.println(
                "File upload status :: " + fileUploadResponse.getStatus()
        );
    }

    @Override
    public void onError(Throwable throwable) {
        System.out.println("Error");
        throwable.printStackTrace();
    }

    @Override
    public void onCompleted() {
        System.out.println("Done");
    }
}
